import java.util.ArrayList;
import java.util.Iterator;

/**
 * @author: 唐小尊
 * @email: 1171702529@qq.com
 * @cate: 2021/03/25 11:54
 */
public class XuanRen {
    public static void main(String[] args) {
        ArrayList<String> list=new ArrayList<String>();
        list.add("111");
        list.add("222");
        list.add("333");

        for(Iterator<String> iterator = list.iterator(); iterator.hasNext();){
            String ele=iterator.next();
            if(ele.equals("111"))
                list.remove("222");
            iterator.remove();
        }
        System.out.println(list);
    }
}
